import React from 'react';
import PropTypes from 'prop-types';
import {Test} from './Test'

export class Home extends React.Component{
    updatePmsg = (e)=>{
        this.props.updatePmsg(e.target.value)
    }
    render(){
        const {pMsg} = this.props
        return(
            <div>
                <Test></Test>
                <p>home comonent</p>
                <p>child pMsg: {pMsg}</p>
                <p>
                  name: <input type="text" value={pMsg} onChange={this.updatePmsg}></input>
               </p>
            </div>
        )
    }
}

Home.propTypes = {
    pMsg:PropTypes.string
}